package com.zr.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.zr.service.FinduppService;
import com.zr.service.SearchUidService;

import net.sf.json.JSONArray;

@Controller
@Scope(value="prototype")
public class Findupp {
	
	HttpServletResponse response = ServletActionContext.getResponse();//直接获得response对象  
	
	@Resource 
	private FinduppService findup;
	
	public void findup(){
		JSONArray j = findup.findUpp();
		response.setCharacterEncoding("utf8");;
		PrintWriter pw;
		try {
			pw = response.getWriter();
			pw.write(j.toString());
			pw.flush();
			pw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

	
	
}
